-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix product publications #2774
Fix product publications #2774
Conversation
… that role for every shop. This is leftover from the original marketplace implementation and no longer necessary.
…ay of perms New server method `Reaction.getShopsWithRoles`, wraps Roles.getGroupsForUser
…WithRoles Massively simplify Product publication. Pass `this.userId` from publications into getShopsWithRoles to satisfy tests Adds stubs for Reaction.hasPermission and getShopsWithRoles
@mikemurray can you give this a review sometime soon? |
Yeah, reviewing now. Question. I have 2 brand shops and the primary shop signed into three browsers. I on the homepage, while signed in as brand 2, I cannot see the products from brand 1. Should I only be able to see my products? Or, is this related to #2760. |
@mikemurray I thought this was publishing all public products as well as products you have admin access for, but it may be that the admin publication supersedes the other publication and results in the other products never getting sent. Now that I've thought about it a little more, it may be good to not publish products that a user doesn't have admin access for when in "edit mode." Having a mixture of editable and non-editable products may cause chaos for the UI and the bulk publish/edit actions. |
@spencern It seems that the admin publication is superseding the "normal user" part of that publication. As an anonymous user, I can see the published products from all shops. But as a brand, I can only see my own shops products on the main grid. |
What do you think about having the publication switch with the "edit mode" switch? Is that too confusing? Any thoughts for how we should we publish products that a user doesn't have admin access for when a user is an admin for at least one shop? (does that make sense?) |
The edit mode might be helpful, at least from the standpoint of being clear that these are my products to edit; you can get that from On the main product grid, we could just adjust the publication to only show products that a normal user would see. Then on the shop's own product grid homepage, we can, of course, show all the editable products for that shop. So basically... As shop owner, In edit mode
As shop owner in, NOT in edit mode ( viewing as a customer )
|
I like this idea. Do we have a navigation link to "my shop" currently? |
We do not. |
Does the |
They may exist if you physically type into the address bar, or do a |
@mikemurray As shop owner, In edit mode As shop owner in, NOT in edit mode ( viewing as a customer ) Might be worth considering changing the language from "edit mode" to From my perspective this PR is ready to be fully reviewed and pulled in. |
@spencern checking now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good with the changes. We will have to revisit anyway with changes to the router and shop filtering.
Fixes hacky product publications that got added to marketplace in haste a couple days ago.
Specifically:
Security Fix
Reaction.hasPermission
. This was code that was leftover from the original sellerShops implementation of marketplace.New Methods
Reaction.getShopsWithRoles
method which provides a list of shopIds that the user has at least one of the provided roles for.Updates
Products
publication now publishes admin products for all shops that a user has access for.